public class UndergraduateException extends Exception {
    private String message;

    public UndergraduateException(String message) {
        super(message);
        this.message = message;
    }

    public String warnMess() {
        return message;
    }

    public static void validateScore(double score) throws UndergraduateException {
        if (score < 0 || score > 100) {
            throw new UndergraduateException("Score out of range: " + score + ". Valid range is 0-100.");
        }
    }

}
